<template>
  <div style="padding: 20px">
    <el-breadcrumb separator="/" style="margin-bottom: 20px" >
      <el-breadcrumb-item >当前位置：</el-breadcrumb-item>
      <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
      <!--      <el-breadcrumb-item><a >订单管理</a></el-breadcrumb-item>-->
    </el-breadcrumb>

    <el-row :gutter="10" style="margin-bottom: 20px" >

      <el-col :span="12">
      <el-card style="height: 440px">
        <div slot="header" class="clearfix">
          <span>EverFlow管理系统</span>

        </div>
        <div  class="text item" style="line-height: 25px">
          <div>
          目前该后台管理系统版本1.2初开发，基于权限通用后台管理，模块有6个基础模块，分别是公告管理、系统管理、首页、权限管理、菜单管理和用户管理，管理员可分配各个角色的权限。随着各个管理系统的功能，
          本系统还提供了代码生成器，快速敏捷的开发出相应的功能。
          </div>
          <div style="margin-top: 15px">
          技术栈：springboot+vue整体框架，前端富文本编辑器、nodejs，后端freemarker模板引擎，mysql数据库。
          </div>
          <div style="margin-top: 15px">
            <span style="font-weight:bold">当前最新版本：</span><span style="color: #409EFF">v1.2</span>
          </div>
        </div>
      </el-card>
      </el-col>

      <el-col :span="12">
        <el-card><div id="main2" style="width: 100%;height:400px;"></div>
        </el-card></el-col>
    </el-row>
    <el-row :gutter="20">

      <el-col :span="12">
        <el-card>
          <div id="main3" style="width: 100%;height:400px;"></div>
        </el-card>
      </el-col>
      <el-card>
        <div id="main" style="width: 100%;height:400px;"></div>
      </el-card>
      <el-col :span="12">
      </el-col>
    </el-row>


  </div>
</template>
<script>
import axios from 'axios';
import * as echarts from 'echarts';
export default {

  data() {
    return {
      chart: null,
      inoutEchart: "",
    };
  },
  destroyed() {

  },
  mounted() {
    this.initchart()
  },
  methods: {
    flush() {
      if (localStorage.getItem("flushlogin1") == null) {
        window.location.reload();
        localStorage.setItem("flushlogin1", 1)
      } else {
        localStorage.removeItem("flushlogin1")
      }
    },
    initchart(){

// 基于准备好的dom，初始化echarts实例
      var chartDom = document.getElementById('main2');
      var myChart = echarts.init(chartDom);
      var option;

      option = {
        title: {
          text: 'Referer of a Website',
          subtext: 'Fake Data',
          left: 'center'
        },
        tooltip: {
          trigger: 'item'
        },
        legend: {
          orient: 'vertical',
          left: 'left'
        },
        series: [
          {
            name: 'Access From',
            type: 'pie',
            radius: '50%',
            data: [
              { value: 1048, name: 'Search Engine' },
              { value: 735, name: 'Direct' },
              { value: 580, name: 'Email' },
              { value: 484, name: 'Union Ads' },
              { value: 300, name: 'Video Ads' }
            ],
            emphasis: {
              itemStyle: {
                shadowBlur: 10,
                shadowOffsetX: 0,
                shadowColor: 'rgba(0, 0, 0, 0.5)'
              }
            }
          }
        ]
      };

      option && myChart.setOption(option);
      //2
      var chartDom = document.getElementById('main');
      var myChart = echarts.init(chartDom);
      var option;

      option = {
        title: {
          text: 'Chart'
        },
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'cross',
            label: {
              backgroundColor: '#6a7985'
            }
          }
        },
        legend: {
          data: ['Email', 'Union Ads', 'Video Ads', 'Direct', 'Search Engine']
        },
        toolbox: {
          feature: {
            saveAsImage: {}
          }
        },
        grid: {
          left: '3%',
          right: '4%',
          bottom: '3%',
          containLabel: true
        },
        xAxis: [
          {
            type: 'category',
            boundaryGap: false,
            data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
          }
        ],
        yAxis: [
          {
            type: 'value'
          }
        ],
        series: [
          {
            name: 'Email',
            type: 'line',
            stack: 'Total',
            areaStyle: {},
            emphasis: {
              focus: 'series'
            },
            data: [120, 132, 101, 134, 90, 230, 210]
          },
          {
            name: 'Union Ads',
            type: 'line',
            stack: 'Total',
            areaStyle: {},
            emphasis: {
              focus: 'series'
            },
            data: [220, 182, 191, 234, 290, 330, 310]
          },
          {
            name: 'Video Ads',
            type: 'line',
            stack: 'Total',
            areaStyle: {},
            emphasis: {
              focus: 'series'
            },
            data: [150, 232, 201, 154, 190, 330, 410]
          },
          {
            name: 'Direct',
            type: 'line',
            stack: 'Total',
            areaStyle: {},
            emphasis: {
              focus: 'series'
            },
            data: [320, 332, 301, 334, 390, 330, 320]
          },
          {
            name: 'Search Engine',
            type: 'line',
            stack: 'Total',
            label: {
              show: true,
              position: 'top'
            },
            areaStyle: {},
            emphasis: {
              focus: 'series'
            },
            data: [820, 932, 901, 934, 1290, 1330, 1320]
          }
        ]
      };

      option && myChart.setOption(option);
      //  3
      var chartDom = document.getElementById('main3');
      var myChart = echarts.init(chartDom);
      var option;

      const colors = ['#5470C6', '#91CC75', '#EE6666'];
      option = {
        color: colors,
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'cross'
          }
        },
        grid: {
          right: '20%'
        },
        toolbox: {
          feature: {
            dataView: { show: true, readOnly: false },
            restore: { show: true },
            saveAsImage: { show: true }
          }
        },
        legend: {
          data: ['Evaporation', 'Precipitation', 'Temperature']
        },
        xAxis: [
          {
            type: 'category',
            axisTick: {
              alignWithLabel: true
            },
            // prettier-ignore
            data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
          }
        ],
        yAxis: [
          {
            type: 'value',
            name: 'Evaporation',
            position: 'right',
            alignTicks: true,
            axisLine: {
              show: true,
              lineStyle: {
                color: colors[0]
              }
            },
            axisLabel: {
              formatter: '{value} ml'
            }
          },
          {
            type: 'value',
            name: 'Precipitation',
            position: 'right',
            alignTicks: true,
            offset: 80,
            axisLine: {
              show: true,
              lineStyle: {
                color: colors[1]
              }
            },
            axisLabel: {
              formatter: '{value} ml'
            }
          },
          {
            type: 'value',
            name: '温度',
            position: 'left',
            alignTicks: true,
            axisLine: {
              show: true,
              lineStyle: {
                color: colors[2]
              }
            },
            axisLabel: {
              formatter: '{value} °C'
            }
          }
        ],
        series: [
          {
            name: 'Evaporation',
            type: 'bar',
            data: [
              2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3
            ]
          },
          {
            name: 'Precipitation',
            type: 'bar',
            yAxisIndex: 1,
            data: [
              2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
            ]
          },
          {
            name: 'Temperature',
            type: 'line',
            yAxisIndex: 2,
            data: [2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2]
          }
        ]
      };

      option && myChart.setOption(option);
    }
  },
};
</script>
<style scoped>

</style>
